<template>
	<view>
		<u-navbar :title="data.title"></u-navbar>
		<view class="u-p-20">
			<rich-text :nodes="data.content"></rich-text>
		</view>
	</view>
</template>

<script setup>
	import {
		reactive,
	} from "vue";
	import {
		onLoad
	} from '@dcloudio/uni-app'
	const data = reactive({
		content: '',
		title: ''
	})
	onLoad(({
		type
	}) => {
		getArticleDetail(type)
	})
	const getArticleDetail = async (type) => {
		let res = await uni.$u.api.getAgreementAndPrivacy()
		if (type == 'privacy') {
			data.title = '隐私政策'
			data.content = res.privacy
		} else {
			data.title = '用户协议'
			data.content = res.agreement
		}
	}
</script>

<style lang="scss">
	.content {
		overflow-x: auto;
	}
</style>